import React from 'react'
import { Form, Input, Button,DatePicker} from 'antd';
const { RangePicker } = DatePicker;
const rangeConfig = {
    rules: [{ type: 'array' as const, required: true, message: '请选择正确的时间' }],
};
export default function index() {
    const onFinish = (values: any) => {
        console.log('Success:', values);
        alert('创建成功')
    };
    return (
            <div>
                <Form
            name="basic"
            labelCol={{ span: 8 }}
            wrapperCol={{ span: 16 }}
            initialValues={{ remember: true }}
            onFinish={onFinish}
            autoComplete="off"
            >
        <Form.Item
            label="试卷名称"
            name="username"
            rules={[{ required: true, message: '请输入试卷名称' }]}
        >
            <Input />
        </Form.Item>
        <Form.Item
            label="选择试卷"
            name="chanceexam"
            rules={[{ required: true, message: '请输入试卷类型' }]}
        >
            <Input />
        </Form.Item>
        <Form.Item
            label="选择课程"
            name="chanceclass"
            rules={[{ required: true, message: '请输入课程类型' }]}
        >
            <Input />
        </Form.Item>
        <Form.Item
            label="设置题量"
            name="setmuch"
            rules={[{ required: true, message: '请输入题量' }]}
        >
            <Input />
        </Form.Item>
        <Form.Item name="range-time-picker" label="请选择时间" {...rangeConfig}>
        <RangePicker showTime format="YYYY-MM-DD HH:mm:ss" />
      </Form.Item>
        <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
            <Button type="primary" htmlType="submit">
                创建试卷
            </Button>
        </Form.Item>
        </Form>
        </div>
    )
}
